package de.akabahn.ebd.stw.gsii.zda;

/**
 * Definition von Konstanten, die innerhalb des Projekts verwendet werden
 * 
 * @author Peter Eimann
 */
public class ZDAConstants {

	// SPERRVARIABLE
	public final static String SPERRE_ZDA = "ARMSTRMESTW";

	// BACKGROUND TASK
	public final static int BGTASK_INITIAL_DELAY  = 5000;
	public final static int BGTASK_DELAY          = 500;
	public final static int PREPARE_RESTART_DELAY = 5000;

	// BITWERTE
	public final static int BIT0 = (int) Math.pow(2, 0);
	public final static int BIT1 = (int) Math.pow(2, 1);
	public final static int BIT2 = (int) Math.pow(2, 2);
	public final static int BIT3 = (int) Math.pow(2, 3);
	public final static int BIT4 = (int) Math.pow(2, 4);
	public final static int BIT5 = (int) Math.pow(2, 5);
	public final static int BIT6 = (int) Math.pow(2, 6);
	public final static int BIT7 = (int) Math.pow(2, 7);
	public final static int BIT8 = (int) Math.pow(2, 8);
	public final static int BIT9 = (int) Math.pow(2, 9);

	// WEICHEN
	public final static int WEICHEN_UMLAUFZEIT = 6000;

	public final static String WEICHE_1 = "08W1";
	public final static String WEICHE_2 = "08W2";
	public final static String WEICHE_3 = "08W3";
	public final static String WEICHE_4 = "08W7";
	public final static String WEICHE_7 = "08W4";

	// WEICHENMELDER
    public final static int MW_AUS        = 0;
    public final static int MW_RE_GELB    = BIT0;
    public final static int MW_RE_GELB_BL = BIT1;
    public final static int MW_RE_ROT     = BIT2;
    public final static int MW_LI_GELB    = BIT3;
    public final static int MW_LI_GELB_BL = BIT4;
    public final static int MW_LI_ROT     = BIT5;
    public final static int MW_VM         = BIT6;
    public final static int MW_VM_BL      = BIT7;
    public final static int MW_UM         = BIT8;
    public final static int MW_UM_BL      = BIT9;

	public final static String MELDER_WEICHE_1 = "S08MW1S";
	public final static String MELDER_WEICHE_2 = "S08MW2S";
	public final static String MELDER_WEICHE_3 = "S08MW3S";
	public final static String MELDER_WEICHE_4 = "S08MW4S";
	public final static String MELDER_WEICHE_7 = "S08MW7S";

	// SIGNALE
	public final static int RA12_LEUCHTDAUER = 60000;
	public final static int ZS1_LEUCHTDAUER = 60000;

	public final static String SIGNAL_11 = "08AS";
	public final static String SIGNAL_12 = "08P2S";
	public final static String SIGNAL_14 = "08P3S";
	public final static String SIGNAL_1  = "08L11XS";
	public final static String SIGNAL_15 = "08L3XS";
	public final static String SIGNAL_6A = "08L14XS";
	public final static String SIGNAL_6  = "08L4YS";
	public final static String SIGNAL_8  = "08L5YS";

	// SIGNALMELDER
	public final static int MS_AUS      = 0;
	public final static int MS_HALT     = BIT0;
	public final static int MS_HALT_BL  = BIT1;
	public final static int MS_FAHRT    = BIT2;
	public final static int MS_FAHRT_BL = BIT3;
	public final static int MS_ZS1      = BIT4;
	public final static int MS_RA12     = BIT5;

	public final static String MELDER_SIGNAL_V11 = "S08MSV11S";
	public final static String MELDER_SIGNAL_11  = "S08MS11S";
	public final static String MELDER_SIGNAL_12  = "S08MS12S";
	public final static String MELDER_SIGNAL_14  = "S08MS14S";
	public final static String MELDER_SIGNAL_1   = "S08MS1S";
	public final static String MELDER_SIGNAL_15  = "S08MS15S";
	public final static String MELDER_SIGNAL_6A  = "S08MS6AS";
	public final static String MELDER_SIGNAL_6   = "S08MS6S";
	public final static String MELDER_SIGNAL_8   = "S08MS8S";

	// GLEISE
	public final static String GLEIS_1001 = "08G1001";
	public final static String GLEIS_11   = "08G11";
	public final static String GLEIS_3    = "08G3";
	public final static String GLEIS_13   = "08G13";
	public final static String GLEIS_0508 = "08G0508";

	// GLEISMELDER
    public final static int MG_AUS  = 0;
    public final static int MG_ROT  = BIT0;
    public final static int MG_GELB = BIT1;

	public final static String MELDER_GLEIS_1001 = "S08MG1001S";
	public final static String MELDER_GLEIS_11   = "S08MG11S";
	public final static String MELDER_GLEIS_3    = "S08MG3S";
	public final static String MELDER_GLEIS_13   = "S08MG13S";
	public final static String MELDER_GLEIS_0508 = "S08MG0508S";
	public final static String MELDER_GLEIS_W1R  = "S08MGW1RS";
	public final static String MELDER_GLEIS_W1L  = "S08MGW1LS";
	public final static String MELDER_GLEIS_W2R  = "S08MGW2RS";
	public final static String MELDER_GLEIS_W2L  = "S08MGW2LS";
	public final static String MELDER_GLEIS_W3R  = "S08MGW3RS";
	public final static String MELDER_GLEIS_W4R  = "S08MGW4RS";
	public final static String MELDER_GLEIS_W4L  = "S08MGW4LS";

	// BLOCK
	public final static int ENTBLOCKT = 1;
	public final static int GEBLOCKT  = 2;

	public final static String VORBLOCK_0508   = "SD08R05V";
	public final static String RUECKBLOCK_0508 = "SD08R05R";
	public final static String ERLAUBNIS_0508  = "SD08R05E";

	// BLOCKMELDER
    public final static int MBL_AUS      = 0;
    public final static int MBL_VB_GELB  = BIT0;
    public final static int MBL_VB_ROT   = BIT1;
    public final static int MBL_RB_GELB  = BIT2;
    public final static int MBL_RB_ROT   = BIT3;
    public final static int MBL_WDHSP    = BIT4;
    public final static int MBL_VB_AKTIV = BIT5;
    public final static int MBL_TASP_EA  = BIT6;
    public final static int MBL_TASP_LA  = BIT7;

	public final static String MELDER_BLOCK_0508 = "S08MBL0508S";

	// FAHRSTRASSEN
	public final static int GLEISFREIMELDUNG_FREI = 1;
	public final static int FRT_NONE = 0;
	public final static int FRT_SH = 1;
	public final static int FRT_FR = 2;
	public final static int FRT_GRH = 3;

	public final static String FST_S11G1 = "FSTS11G1";
	public final static String FST_S11G4 = "FSTS11G4";
	public final static String FST_S12ZDM = "FSTS12ZDM";
	public final static String FST_S14ZDM = "FSTS14ZDM";
	public final static String FST_W1G1 = "FSTW1G1";
	public final static String FST_W1S12 = "FSTW1S12";
	public final static String FST_W1S14 = "FSTW1S14";

	// TASTEN
	public final static int TASTE_AKTIV = 1;

	public final static String TASTE_PREFIX_GRUPPE = "S08TGR";
	public final static String TASTE_WG            = TASTE_PREFIX_GRUPPE + "WGI";
	public final static String TASTE_ERL           = TASTE_PREFIX_GRUPPE + "ERLI";
	public final static String TASTE_SH            = TASTE_PREFIX_GRUPPE + "SHI";
	public final static String TASTE_RS            = TASTE_PREFIX_GRUPPE + "RSI";
	public final static String TASTE_FR            = TASTE_PREFIX_GRUPPE + "FRI";
	public final static String TASTE_ANSCH         = TASTE_PREFIX_GRUPPE + "ANSCHI";
	public final static String TASTE_HVBL          = TASTE_PREFIX_GRUPPE + "HVBLI";
	public final static String TASTE_WWAB          = TASTE_PREFIX_GRUPPE + "WWABI";
	public final static String TASTE_WS            = TASTE_PREFIX_GRUPPE + "WSI";
	public final static String TASTE_WE            = TASTE_PREFIX_GRUPPE + "WEI";
	public final static String TASTE_WLEIN         = TASTE_PREFIX_GRUPPE + "WLEINI";
	public final static String TASTE_WLAB          = TASTE_PREFIX_GRUPPE + "WLABI";
	public final static String TASTE_SWAB          = TASTE_PREFIX_GRUPPE + "SWABI";
	public final static String TASTE_GRH           = TASTE_PREFIX_GRUPPE + "GRHI";
	public final static String TASTE_ERS           = TASTE_PREFIX_GRUPPE + "ERSI";
	public final static String TASTE_IND           = TASTE_PREFIX_GRUPPE + "INDI";

	public final static String TASTE_PREFIX_GLEIS  = "S08TGL";
	public final static String TASTE_RBL           = TASTE_PREFIX_GLEIS + "RBLI";
	public final static String TASTE_G0508         = TASTE_PREFIX_GLEIS + "G0508I";
	public final static String TASTE_G1            = TASTE_PREFIX_GLEIS + "G1I";
	public final static String TASTE_S11           = TASTE_PREFIX_GLEIS + "S11I";
	public final static String TASTE_S12           = TASTE_PREFIX_GLEIS + "S12I";
	public final static String TASTE_S14           = TASTE_PREFIX_GLEIS + "S14I";
	public final static String TASTE_S1            = TASTE_PREFIX_GLEIS + "S1I";
	public final static String TASTE_S6A           = TASTE_PREFIX_GLEIS + "S6AI";
	public final static String TASTE_S15           = TASTE_PREFIX_GLEIS + "S15I";
	public final static String TASTE_S6            = TASTE_PREFIX_GLEIS + "S6I";
	public final static String TASTE_S8            = TASTE_PREFIX_GLEIS + "S8I";
	public final static String TASTE_W1            = TASTE_PREFIX_GLEIS + "W1I";
	public final static String TASTE_W2            = TASTE_PREFIX_GLEIS + "W2I";
	public final static String TASTE_W3            = TASTE_PREFIX_GLEIS + "W3I";
	public final static String TASTE_W4            = TASTE_PREFIX_GLEIS + "W4I";
	public final static String TASTE_W7            = TASTE_PREFIX_GLEIS + "W7I";

	// SONSTIGE MELDELAMPEN
    public final static int ME_AUS = 0;
    public final static int ME_AN  = BIT0;
    public final static int ME_BL  = BIT1;

    public final static String MELDER_FEMA  = "S08MEFEAS";
	public final static String MELDER_FEME  = "S08MEFEES";
	public final static String MELDER_FFM11  = "S08MEFFAS";
	public final static String MELDER_FFM12 = "S08MEFFP2S";
	public final static String MELDER_FFM14 = "S08MEFFP3S";
	public final static String MELDER_WWAB  = "S08MEWWABS";
	public final static String MELDER_WLAB  = "S08MEWLABS";
	public final static String MELDER_SWAB  = "S08MESWABS";
	public final static String MELDER_GRTK  = "S08MEGRTKS";
	public final static String MELDER_SS    = "S08MESSS";
	public final static String MELDER_BLL   = "S08MEBLLS";
	public final static String MELDER_BLR   = "S08MEBLRS";
	public final static String MELDER_RST   = "S08MERSTS";
	public final static String MELDER_ST    = "S08MESTS";
	public final static String MELDER_SN    = "S08MESNS";
	public final static String MELDER_TT    = "S08METTS";
	public final static String MELDER_TN    = "S08METNS";
	public final static String MELDER_BN    = "S08MEBNS";
	public final static String MELDER_BB    = "S08MEBBS";
	public final static String MELDER_IND   = "S08MEINDS";

	// WECKER
    public final static int WE_AUS = 0;
    public final static int WE_AN  = BIT0;

    public final static String WECKER_1 = "S08WE1S";
    public final static String WECKER_2 = "S08WE2S";
}
